<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('FinalAcceptanceExamination/index')}">单位工程竣工验收报审表管理</a></li>
            <if condition="($Role eq 2) AND ($userrole['role'] eq 5)">
            	<li><a href="{:U('FinalAcceptanceExamination/add')}">新增单位工程竣工验收报审</a></li>
            </if>
        </ul> 
        
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th width="15%">编号</th>
                    <th>工程名称</th>
                    <th width="12%">审批状态</th>
                    <th width="12%">创建人</th>
                    <th width="12%">创建时间</th>
                    <th width="20%">{:L('ACTIONS')}</th>
                </tr>
            </thead>
             <tbody>
            <foreach name="results" item="vo">
                <tr>
                    <td>{$vo.code}</td>
                    <td>{$vo.project_name}</td>
                    <td class="text-center">
                        <if condition="$vo['audit_status'] eq 1">
                            审核中 (<php>echo intval($vo['audit_level']) - 1;</php> / <php>echo (intval(($vo['level'] != '' ? $vo['level'] : 0)) + 1) * 2;</php> )
                        <elseif  condition="$vo['audit_status'] eq 2" />
                        	已驳回
                        <else />
                            已通过
                        </if>
                    </td>
					<td>{$vo.real_name}</td>
				    <td>{$vo.publish_time}</td>
                    <td>

                        <if condition="$vo['permission'] == 1 || $vo['permission'] == 2">
                            <a href='{:U("FinalAcceptanceExamination/view",array("id"=>$vo["id"]))}'> {$vo['action_text']}</a>
                            <else/>
                            <a href='{:U("FinalAcceptanceExamination/view",array("id"=>$vo["id"]))}'> 查看</a>
                        </if>
                        <!--如果当前用户为授权用户，同时其他用户并未操作一级审核和二级审核-->
                        <if condition="$role_id==4">
                            <if condition="$vo['edit_no']==1">
                                |<a href='{:U("FinalAcceptanceExamination/distribution",array("id"=>$vo["id"],"level"=>$vo["audit_level"]-1))}'>分配</a>
                                <else/>
                                <if condition="$vo['edit_no']==3">
                                    <else/>
                                    |<a href='{:U("FinalAcceptanceExamination/distribution",array("id"=>$vo["id"],"level"=>$vo["audit_level"]-1))}'>已分配</a>
                                </if>
                            </if>
                        </if>
                        |<a href='{:U("FinalAcceptanceExamination/auditHistory", array("id"=>$vo["id"]))}'>审批流程</a>
                        <if condition="$role_id eq 0">
                        |
                        <a class="js-ajax-delete" href="{:U('FinalAcceptanceExamination/delete',array('id'=>$vo['id']))}">删除</a>
                        </if>
                    </td>
                </tr>
            </foreach>
            </tbody>            
        </table>
        <div class="pagination">{$page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>